<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script>
    'use strict';

    var user = {
      name: "zjz",
      age: 22,
      sex: "男"
    };

    // 对象转换为json字符串
   var jsonUser =  JSON.stringify(user);
   // jso字符串转换为对象
    var obj = JSON.parse(jsonUser);
    var obj1 = JSON.parse("{\"name\":\"zjz\",\"age\":22,\"sex\":\"男\"}");
    var obj2 = JSON.parse('{"name":"zjz","age":22,"sex":"男"}');

/*
    {"name": "zjz"}
    {"age": "3"}
    {"sex": "男"}
    */
  </script>
</head>
<body>

</body>
</html>